import React from 'react';
// import { HashRouter as Router, Route, Routes } from 'react-router-dom';
// import { HashRouter as Router, Route, Navink } from "react-router-dom"
// import Main from '../pages/main'
// import Category from '../pages/category'

// import Cart from '../pages/cart'
// import Me from '../pages/me'
// import Login from '../pages/login'
// import Title from '../pages/title'
// // import Alllist from '../pages/alllist'
// import Page404 from '../pages/page404'
// import TabAllList from '../pages/taballlist'
// import '../font/iconfont.css'

const Main = React.lazy(() => import('../pages/main'))
const Category = React.lazy(() => import('../pages/scategory'))
const Cart = React.lazy(() => import('../pages/cart'))
const Me = React.lazy(() => import('../pages/me'))
const Login = React.lazy(() => import('../pages/login'))
const Title = React.lazy(() => import('../pages/title'))
const TabAllList = React.lazy(() => import('../pages/taballlist'))
const Page404 = React.lazy(() => import('../pages/page404'))
const Search = React.lazy(() => import('../pages/search'))
const Order = React.lazy(() => import('../pages/order'))
const Pay = React.lazy(() => import('../pages/pay'))
const AllList = React.lazy(() => import('../pages/alllist'))
const Advance = React.lazy(() => import('../pages/advance'))

const routes = [
    { path: '/', element: <Main />, auth: false, name: '/' },
    { path: '/category', element: <Category />, auth: false, name: '/category' },

    { path: '/cart', element: <Cart />, auth: true, name: '/cart' },
    { path: '/tabAllList', element: <TabAllList />, auth: false, name: '/tabAllList' },
    { path: '/me', element: <Me />, auth: true, name: '/me' },
    { path: '/title/:id', element: <Title />, auth: false, name: '/title' },
    { path: '/login', element: <Login />, auth: false, name: '/login' }
    , { path: '/page404', element: <Page404 />, auth: false, name: '/page404' }
    , { path: '/search', element: <Search />, auth: false, name: '/search' }
    , { path: '/order', element: <Order />, auth: false, name: '/order' }
    , { path: '/pay', element: <Pay />, auth: false, name: '/pay' }
    , { path: '/advance', element: <Advance />, auth: false, name: '/advance' }
    , { path: '/allList/:keyword', element: <AllList />, auth: false, name: '/allList' }
]

export default routes
